package XPathProj;

import org.w3c.dom.NodeList;
import org.w3c.dom.Node;

/**
 * @author Amiad
 *
 */

public abstract class XpathProjectNodeList implements NodeList{

	private NodeList nodeList=null;
		
	/**
	 * Set the nodeList variable.
	 * @param nodeList
	 */
	void setNodeList(NodeList nodeList) {
		this.nodeList = nodeList;
	}

	
	/* (non-Javadoc)
	 * @see org.w3c.dom.NodeList#item(int)
	 */
	@Override
	public Node item(int index) {
		return nodeList.item(index);
	}

	/* (non-Javadoc)
	 * @see org.w3c.dom.NodeList#getLength()
	 */
	@Override
	public int getLength() {
		return nodeList.getLength();
	}	
	
	/**
	 * Returns a string which represents the path that XPath did
	 * to get to the indexth item in the collection. 
	 * If index is greater than or equal to the number of nodes in the list, this returns null. 
	 * @param Index into the collection 
	 * @return The path done by XPath to the node at the indexth position in the NodeList,
	 * or null if that is not a valid index.
	 */
	public abstract String itemPath(int index);

}
